<!--
 * @FileDescription 坐标系标定表单
 * @Author 杨宇翔
 * @Date 20220627 11:40:31
 * @LastEditors 杨宇翔
 * @LastEditTime 20220627 11:40:31
-->
<template>
    <div class="calibration-gizmos-form"
        v-show="CalibrationComponent.Default.ShowForms.value && CalibrationComponent.Default.Id.value == 3">
        <div class="container">
            <div class="header">
                <span>航向偏置标定(单位:°)</span>
                <span class="material-icons" @click="CalibrationComponent.Default.ShowForms.value = false">cancel</span>
            </div>
            <span>角度测量</span>
            <div class="distance-container">
                <div class="distance-container-column">
                    <span>主天线底部中心至惯导中心夹角：</span>
                    <span>副天线底部中心至惯导中心夹角：</span>
                </div>
                <div class="distance-container-column">
                    <input class="reset" type="number" name="LeftAngle"
                        v-model="CalibrationComponent.Default.AzimuthMainAntenna.value">
                    <input class="reset" type="number" name="RightAngle"
                        v-model="CalibrationComponent.Default.AzimuthSubAntenna.value">
                </div>
            </div>
            <span>航向偏置计算</span>
            <div class="calculate-container">
                <div class="calculate-container-column">
                    <span>航向偏置角度：</span>
                </div>
                <div class="calculate-container-column">
                    <input class="reset" type="number" step="1"
                        v-model="CalibrationComponent.Default.AzimuthAngle.value">
                </div>
            </div>
            <button class="reset" type="button" @click="CalibrationComponent.Default.SubmitAzimuthAsync()">
                <span>标定</span>
            </button>
        </div>
    </div>
</template>

<script setup lang="ts">
import { CalibrationComponent } from './InertialNavigationComponent';
</script>

<style scoped>
.calibration-gizmos-form {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;

    backdrop-filter: blur(1rem);
}

.container {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);

    width: 73rem;
    height: 58rem;

    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;

    gap: 2rem;

    border-radius: 2rem;
    border: solid 0.6rem transparent;
    background-image: linear-gradient(#131620, #131620),
        linear-gradient(90deg, #218cde, #807de1);
    background-origin: border-box;
    background-clip: content-box, border-box;
}

.header {
    width: 100%;

    padding: 2rem;

    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header>span:first-of-type {
    color: white;
    font-size: 2.4rem;
    font-weight: 500;
}

.header>.material-icons {
    color: #81859C;
    font-size: 3.6rem;
}

.container>span {
    padding-left: 3.4rem;
    width: 100%;

    color: #81859C;
    font-size: 2.4rem;
    font-weight: 500;
}

.distance-container,
.calculate-container {
    width: 100%;

    padding-left: 4rem;
    padding-right: 4rem;
    padding-bottom: 2rem;
}

.distance-container,
.calculate-container {
    display: flex;
    justify-content: space-between;
}

.distance-container-column,
.calculate-container-column {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 2rem;
}

.distance-container-column>span,
.calculate-container-column>span {
    height: 3.6rem;
    color: #81859C;
    font-size: 1.8rem;
    line-height: 3.6rem;
}

.distance-container-column>span {
    width: 30rem;
}

.calculate-container-column:not(:first-of-type)>span {
    width: 2rem;
}

.distance-container-column:nth-of-type(3),
.calculate-container-column:nth-of-type(2n) {
    margin-left: auto;
}

.distance-container-column>input,
.calculate-container-column>input {
    margin: 0;
    padding: 1.5rem;

    width: 15rem;
    height: 3.6rem;
    color: #B1B1D4;
    font-size: 1.8rem;
    line-height: 3.6rem;
    text-align: center;

    border: solid 0.1rem #36384B;
}

input::-webkit-inner-spin-button,
input::-webkit-outer-spin-button {
    display: none;
}

.distance-container-column>input:focus,
.calculate-container-column>input:focus {
    border: solid 0.1rem;
    border-image: linear-gradient(90deg, rgba(128, 125, 225, 1), rgba(33, 140, 222, 1)) 1 1;
}

button {
    width: 25rem;
    height: 10rem;

    margin-top: 2rem;

    /* background-image: url('/static/InertialNavigation/btn-bg.png'); */
    background-size: contain;
}

button>span {
    color: white;
    font-size: 3rem;
    padding-left: 1em;
    letter-spacing: 1em;
}
</style>